package de.tum.beilmeiner.im.shared.model;

import java.util.HashMap;

import com.google.gwt.user.client.rpc.IsSerializable;

import de.novanic.eventservice.client.event.domain.Domain;
import de.novanic.eventservice.client.event.domain.DomainFactory;
import de.tum.beilmeiner.im.client.bundle.ChatRoomBundle;

public class User implements IsSerializable{

	private String userId = null;
	private String password = null;
	private String vorname = null;
	private String name = null;
	private Domain userDomain = null;
	private HashMap<Domain, ChatRoom> allChatRooms = null;
	public User(){}
	
	public User(String userId, String password, String vorname, String name)
	{
		this.userId = userId;
		this.password = password;
		this.vorname = vorname;
		this.name = name;
		this.userDomain = DomainFactory.getDomain(userId);
		this.allChatRooms = new HashMap<Domain, ChatRoom>();
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getVorname() {
		return vorname;
	}

	public void setVorname(String vorname) {
		this.vorname = vorname;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Domain getUserDomain() {
		return userDomain;
	}

	public void setUserDomain(Domain userDomain) {
		this.userDomain = userDomain;
	}

	public ChatRoom getChatRoom(Domain uuid) {
		return allChatRooms.get(uuid);
	}

	public ChatRoom addChatRoom(ChatRoom newroom) {
		allChatRooms.put(newroom.getUUID(), newroom);
		System.out.println("returning new Room.."+newroom.getRoomId());
		return newroom;
	}
	
	
	
	

}
